<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" xmlns:c="http://java.sun.com/jsp/jstl/core">
	<ui:composition template="/layout/template.xhtml">
		<ui:define name="head">
			<title><h:outputText value="#{backApp.fullTitle}" /></title>
		</ui:define>
		<ui:define name="body">
			<rich:panel>
				<f:facet name="header">
					<h:outputText rendered="#{userLogin.logged}" value="Selecione o serviço que deseja e arraste para sua cesta."></h:outputText>
					<h:outputText rendered="#{not userLogin.logged}"
						value="Veja os Produtos que a FullService está preparada a lhe oferecer!."></h:outputText>
				</f:facet>
				<rich:dragIndicator id="indicator" />
				<h:form id="form">
					<h:panelGrid columnClasses="panelc" columns="2" width="100%">
						<ui:include src="/store/listAllProducts.xhtml">
								<ui:param name="products" value="#{storeManager.products}" /> 
								<ui:param name="startText" value="Processando Registro da Tabela" />
								<ui:param name="stopText" value="" />
							</ui:include>
						<rich:panel with="50%" rendered="#{userLogin.logged}">
							<f:facet name="header">
								<h:outputText value="Serviços Contratados (Cesta de Produtos)" />
							</f:facet>
							<rich:dropSupport dropListener="#{servicesManager.processDrop}" reRender="basketTable,src" />
							<h:dataTable id="basket" columns="1" value="#{servicesManager.basket}" var="itemBasket">
								<h:column>
									<h:outputText value="#{itemBasket.name}" />
								</h:column>
								<f:facet name="footer">
									<a4j:commandButton action="#{serviceManager.reset}" value="Remover Todos os Serviços extras"
										reRender="src,basket" />
									<br />
									<a4j:commandButton action="#{serviceManager.reset}" value="Finalizar Contratação" reRender="src,basket" />
								</f:facet>
							</h:dataTable>
						</rich:panel>
					</h:panelGrid>
				</h:form>
				<a4j:outputPanel ajaxRendered="true">
					<h:messages />
				</a4j:outputPanel>
			</rich:panel>
		</ui:define>
	</ui:composition>
</html>